﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache"/>   
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate"/>  
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1″ /> 
<meta http-equiv="expires" content="0"/> 
<title>橡树空间管理系统</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />

<!--[if lte IE 9]>
       <script language="JavaScript" src="js/json2.js"></script>
       <script language="JavaScript" src="js/jquery1.4.1.js"></script>      
<![endif]-->
<!--[if gt IE 9]><!-->
        <script language="JavaScript" src="js/jquery.js"></script>
<!--<![endif]-->

<script src="js/cloud.js" type="text/javascript"></script>

<script language="javascript">
$(function(){
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
	$(window).resize(function(){  
    	$('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
   	});
});  		





	

function login(){
    var username = $(".loginuser").val();
    var password = $(".loginpwd").val();
    var parameter = {username:username,password:password};
	try{
	    $.ajax({
	        url: '/euc/user/loginValidate',
	        data:JSON.stringify(parameter),
	        beforeSend: function(request) {
	        	var accessToken = localStorage.getItem('accessToken');
	            request.setRequestHeader("accessToken",accessToken );
	            //alert(accessToken);
	        },
	        dataType: 'JSON',
	        async: false,
	        contentType:'application/json;charset=utf-8',
	        type: 'POST',
	        crossDomain:true,
	        success: function(data, textStatus, response) {
	        	if(isIE()){
	        		data =(new Function("","return "+data))();
	        	}
	            var accessToken = response.getResponseHeader('accessToken');
	            var refreshToken = response.getResponseHeader('refreshToken');
	            var expiresIn = response.getResponseHeader('expiresIn');
	            var isBusiManage = response.getResponseHeader('isBusiManage');
	            localStorage.setItem('accessToken',accessToken);
	            localStorage.setItem('refreshToken',refreshToken);
	            localStorage.setItem('expiresIn',expiresIn);	            
	            localStorage.setItem('isBusiManage',isBusiManage);	            
	            if (data.status == 0) {
						window.parent.location.href="/euc/home/page";
	            }else{
	            	
	            	alert(data.message);
	            	//$(".tipright").find("p").html(data.message);
	            	//$(".tipright").find("cite").html("");		
	            	//$(".tip").fadeIn(200);
	            	//$(".sure").click(function(){	            		
	            	//	$(".tip").fadeOut(100);
	            	//});
            	  	//$(".tiptop a").click(function(){
            		//  $(".tip").fadeOut(200);
            		//});
	            }	            
	        },
	        error: function () {
	            alert("error");
	        }
	    });
	
	}
	catch(e){
	    alert(e.message);
	}
}

function isIE() { //ie? 
		if (!!window.ActiveXObject || "ActiveXObject" in window)  return true;  else  return false; };

</script> 

</head>

<body style="background-color:#1c77ac; background-image:url(images/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">



    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  


<div class="logintop">    
  <!--   <span>欢迎登录</span>    
    <ul>
    <li><a href="#">回首页</a></li>
    <li><a href="#">帮助</a></li>
    <li><a href="#">关于</a></li>
    </ul>     -->
    </div>
    
    <div class="loginbody">
    
    <span class="systemlog  o"></span> 
       
    <div class="loginbox">
    
    <ul>
    <li><input name="" type="text" class="loginuser" value="" onclick="JavaScript:this.value=''"/></li>
    <li><input name="" type="password" class="loginpwd" value="" onclick="JavaScript:this.value=''"/></li>
    <li><input name="" type="button" class="loginbtn" value="登录"  onclick="login()"  />
    <label><input name="" type="checkbox" value="" checked="checked" />记住密码</label>
    <label style="display:none;"><a href="#">注册</a></label>
    </li>
    </ul>
    
    
    </div>
    
    </div>
    
    
    
    <div class="loginbm">版权所有 </div>
    
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>        
		<div class="tipinfo">
			<span><img src="images/ticon.png" /></span>
		  	<div class="tipright">
			  <p>是否确认对信息的修改 ？</p>
			  <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
		  	</div>
		</div>		  
	  	<div class="tipbtn">
		  <input name="" type="button"  class="sure" value="确定" />&nbsp;
		</div>    
    </div>
</body>
</html>
